home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr53
/
pctv4n_1.zip
/
FASTHEX.ASM
< prev
next >
Wrap
Assembly Source File
|
1993-06-10
|
697b
|
39 lines
; Convert byte in AL into ASCII representation in AX
; (AL = MSB, AH=LSB)
; Uses Turbo Assembler
IDEAL
MODEL SMALL
CODESEG
hexbyte_small:
db 0d4h ; AAM 16 !
db 16
add al, 90h
daa
adc al, 40h
daa
xchg ah, al
add al, 90h
daa
adc al, 40h
daa
ret
hexbyte_fast:
mov bx, OFFSET hextbl
mov ah, al
; high nybble
and al, 0fh
xlat
; low nybble
xchg ah, al
mov cl, 4
shr al, cl
xlat
ret
DATASEG
hextbl DB '0123456789ABCDEF'
END